package demo1;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();


        while(t-- != 0){
            int n = in.nextInt(), key = 0;
            String[] s = new String[n];
            char[][] ch = new char[n][26];
            for(int i = 0; i < n; i++){
                s[i] = in.next();
                for(int j = 0; j < s[i].length(); j++){
                    ch[i][s[i].charAt(j) - 'a']++;
                }
            }

            int left = 0, right = s.length - 1;
            while(left < right){
                for(int i = 0; i < 26; i++){
                    if(!(ch[left][i] > 0 && ch[right][i] > 0)){
                        key = 1;
                        left = right;
                        break;
                    }
                }
                left++;
                right--;
            }
            System.out.println(key == 1 ? "No" : "Yes");
        }
    }
}
